package com.yumeng.config.helper;

import com.yumeng.config.properties.ProjectProperties;
import com.yumeng.config.properties.YumengAuthProperties;
import com.yumeng.config.properties.YumengMybatisPlusProperties;
import com.yumeng.config.properties.YumengProperties;
import lombok.Getter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.web.ServerProperties;
import org.springframework.stereotype.Component;

/**
 *
 * @author wxd
 * @date 2025/9/30 10:04
 */
@Component
public class PropHelper {

    @Getter
    private static ServerProperties serverProperties;
    @Autowired
    public void setServerProperties(ServerProperties serverProperties) {
        PropHelper.serverProperties = serverProperties;
    }




    @Getter
    private static ProjectProperties projectProperties;
    @Getter
    private static YumengProperties yumengProperties;
    @Getter
    private static YumengAuthProperties.YumengBasicProperties authBasicProperties;
    @Getter
    private static YumengAuthProperties.JwtProperties jwtProperties;
    @Getter
    private static YumengMybatisPlusProperties mybatisPlusProperties;
    @Autowired
    public void setProjectProperties(ProjectProperties projectProperties) {
        PropHelper.projectProperties = projectProperties;
    }
    @Autowired
    public void setYumengProperties(YumengProperties yumengProperties) {
        PropHelper.yumengProperties = yumengProperties;
    }
    @Autowired
    public void setYumengAuthProperties(YumengAuthProperties yumengAuthProperties) {
        PropHelper.authBasicProperties = yumengAuthProperties.getBasic();
        PropHelper.jwtProperties = yumengAuthProperties.getJwt();
    }
    @Autowired
    public void setMybatisPlusProperties(YumengMybatisPlusProperties mybatisPlusProperties) {
        PropHelper.mybatisPlusProperties = mybatisPlusProperties;
    }

}
